//
//  HNHomeNavigationBarView.m
//  HappyNews
//
//  Created by baiping on 16/1/11.
//  Copyright © 2016年 BPWBANP. All rights reserved.
//

#import "HNHomeNavigationBarView.h"
@interface HNHomeNavigationBarView()

@end


@implementation HNHomeNavigationBarView

- (instancetype)initWithFrame:(CGRect)frame{
    // 调以下父类方法
    self = [super initWithFrame:frame];
    
    if (self) {
        
     
        _meBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
        
      
        
        [self addSubview:_meBtn];
        
        
        _locationBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
        
        
      //  _locationBtn.backgroundColor = [UIColor redColor];
        
        _changeLocation  = [UIButton buttonWithType:(UIButtonTypeCustom)];
        
      
        [self addSubview:_changeLocation];
        
        [self addSubview:_locationBtn];
        
        _meBtn.frame = CGRectMake(10, 30, 28, 28);
        
        _locationBtn.frame = CGRectMake(_meBtn.right + 5, _meBtn.top, 60, 28);
       
         _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreenWidth / 2 -60, 25, 150, 40)];
        
        _titleLabel.font = [UIFont boldSystemFontOfSize:17];
        
        _locationBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
        
        [self addSubview:_titleLabel];
        
        _locationBtn.titleLabel.font = [UIFont systemFontOfSize:14];
        
        [_locationBtn setTitleColor:[UIColor grayColor] forState:(UIControlStateNormal)];
        
    
    }
    
    return self;
}

- (void)layoutSubviews{
    
    
      _changeLocation.frame = CGRectMake(_locationBtn.right, _locationBtn.top + 8, 14, 14);
    
    
    
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
